package com.ruoyi.jypc.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jypc.mapper.DriverMapper;
import com.ruoyi.jypc.domain.Driver;
import com.ruoyi.jypc.service.IDriverService;

/**
 * 司机信息Service业务层处理
 * 
 * @author xymc
 * @date 2022-11-16
 */
@Service
public class DriverServiceImpl implements IDriverService 
{
    @Autowired
    private DriverMapper driverMapper;

    /**
     * 查询司机信息
     * 
     * @param driverid 司机信息主键
     * @return 司机信息
     */
    @Override
    public Driver selectDriverByDriverid(Long driverid)
    {
        return driverMapper.selectDriverByDriverid(driverid);
    }

    /**
     * 查询司机信息列表
     * 
     * @param driver 司机信息
     * @return 司机信息
     */
    @Override
    public List<Driver> selectDriverList(Driver driver)
    {
        return driverMapper.selectDriverList(driver);
    }

    /**
     * 新增司机信息
     * 
     * @param driver 司机信息
     * @return 结果
     */
    @Override
    public int insertDriver(Driver driver)
    {
        driver.setCreateTime(DateUtils.getNowDate());
        return driverMapper.insertDriver(driver);
    }

    /**
     * 修改司机信息
     * 
     * @param driver 司机信息
     * @return 结果
     */
    @Override
    public int updateDriver(Driver driver)
    {
        driver.setUpdateTime(DateUtils.getNowDate());
        return driverMapper.updateDriver(driver);
    }

    /**
     * 批量删除司机信息
     * 
     * @param driverids 需要删除的司机信息主键
     * @return 结果
     */
    @Override
    public int deleteDriverByDriverids(Long[] driverids)
    {
        return driverMapper.deleteDriverByDriverids(driverids);
    }

    /**
     * 删除司机信息信息
     * 
     * @param driverid 司机信息主键
     * @return 结果
     */
    @Override
    public int deleteDriverByDriverid(Long driverid)
    {
        return driverMapper.deleteDriverByDriverid(driverid);
    }
}
